
<?php   
   include("../funcs/funcs.php");
   $id=intval($_GET['id']);
   if(!$id) back();
   $conn=localConnectUsm();
   $sql="select * from news where id=".$id;  
   $query=mssql_query($sql); 
   $num=mssql_num_rows($query);  
   if(!$row=mssql_fetch_array($query)){
     header("location:news/error.html");
   }else{
   
    $path=$row['filepath'];
	$url='news/'.$path.'/'.$id.'.html';
	$error='news/error.html';
	if(file_exists($url))
	header("location:".$url);
    else
	header("location:".$error);
   }
   
?>

